#ifndef WIFI_API_H__
#define WIFI_API_H__

#include <stdlib.h>
#include <string.h>
#include <time.h>

#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/event_groups.h"

#include "esp_system.h"
#include "esp_wifi.h"
#include "esp_event_loop.h"
#include "esp_log.h"

#define EXAMPLE_WIFI_SSID "xxxxx"
#define EXAMPLE_WIFI_PASS "lsp19890922."

#define AP_DIGIMON_WIFI_SSID "DIGIMON"
#define AP_DIGIMON_WIFI_PASS "11111111"
#define AP_DIGIMON_MAX_STA_CONN 2

#define SYS_WIFI_STATUS_UNCONNECT   0
#define SYS_WIFI_STATUS_CONNECTING  1
#define SYS_WIFI_STATUS_CONNECTED   2
#define SYS_WIFI_STATUS_CONNECT_ERR 3
#define SYS_WIFI_STATUS_SAMRTCONFIG 4

typedef struct _wifi
{
    uint8_t wifi_status;
    char ssid[32];
    char passwd[32];
    void (*init_sta)(void);
    void (*init_ap)(void);
    void (*close_wifi)(void);
} Wifi;
extern Wifi wifi;
void wifi_init();

#endif